﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Booky.DataStorage
{
    public enum AddressType
    { 
        Billing = 1,
        Shipping = 2,
        Work = 3,
        Mailing = 4
        
    }

    public class Address
    {
         public int ID { get; set; }

        /// <summary>
        /// Email - The Contact Address Email Address
        /// </summary>
        public string Email { get; set; }

        /// <summary>
        /// Street1 - The Contact Address Street line one
        /// </summary>
        public string Street1 { get; set; }

        /// <summary>
        /// Street2 - The Contact Address Street line two
        /// </summary>
        public string Street2 { get; set; }

        /// <summary>
        /// City - The Contact Address City
        /// </summary>
        public string City { get; set; }

        public int StateProvinceId { get; set; }

        // TODO: need Province type/object
        // TODO: need Country type/object

        public string Zip { get; set; }

        public int CountryId { get; set; }

        public Address() { }

        public Address(string email, string street1, string street2, string city, string zip)
        {
            this.Email = email;
            this.Street2 = street1;
            this.Street2 = street2;
            this.City = city;
            this.Zip = zip;
        }

        #region object overrides
        public override bool Equals(object obj)
        {
            if (obj is Address)
            {
                Address compareTo = (Address)obj;
                return compareTo.ID == this.ID;
            }
            else
            {
                return base.Equals(obj);
            }
        }

        public override string ToString()
        {
            return this.Email;
        }
        public override int GetHashCode()
        {
            return this.ID.GetHashCode();
        }
        #endregion

    }

}
